/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef NCSI_WX_H
#define NCSI_WX_H

#include <stdint.h>

#define WX_OEM_CMD_REV               0x01

#define WX_CMD_GET_SERIAL_NUMBER     0x10
#define WX_CMD_GET_LLDP_CAPABILITY   0x11
#define WX_CMD_GET_MAC_ADDRESS       0x13
#define WX_CMD_GET_TEMPERATURE       0x14
#define WX_CMD_ENABLE_LLDP           0x40
#define WX_CMD_DISABLE_LLDP          0x41

#define WX_RESP_CODE_SUCCESS         0x0000
#define WX_REASON_CODE_SUCCESS       0x0000

#define WX_SERIAL_NUMBER_MAX_LEN 9
#define PROP_VAL_LENGTH 64

#pragma pack(1)
typedef struct oem_wx_common_rsp {
    uint16_t response_code;
    uint16_t reason_code;
    uint32_t manufacturer_id;
    uint8_t command_rev;
    uint8_t command_id;
} oem_wx_common_rsp_t;

typedef struct oem_wx_temperature_rsp {
    oem_wx_common_rsp_t wx_rsp_common_header;
    uint8_t max_temp;
    uint8_t cur_temp;
    uint32_t check_sum; 
} oem_wx_temperature_rsp_t;

typedef struct oem_wx_mac_address_rsp {
    oem_wx_common_rsp_t wx_rsp_common_header;
    uint8_t mac_addr[6];
    uint32_t check_sum;
} oem_wx_mac_address_rsp_t;

typedef struct oem_wx_serial_number_rsp {
    oem_wx_common_rsp_t wx_rsp_common_header;
    char serial_number[WX_SERIAL_NUMBER_MAX_LEN];
    uint32_t check_sum;
} oem_wx_serial_number_rsp_t;

typedef struct oem_wx_get_lldp_rsp {
    oem_wx_common_rsp_t wx_rsp_common_header;
    uint8_t lldp_capability;
    uint32_t check_sum;
} oem_wx_get_lldp_rsp_t;

#pragma pack()

#endif // NCSI_WX_H 